{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "               _                           \n",
       "platform       x86_64-pc-linux-gnu         \n",
       "arch           x86_64                      \n",
       "os             linux-gnu                   \n",
       "system         x86_64, linux-gnu           \n",
       "status                                     \n",
       "major          3                           \n",
       "minor          3.1                         \n",
       "year           2016                        \n",
       "month          06                          \n",
       "day            21                          \n",
       "svn rev        70800                       \n",
       "language       R                           \n",
       "version.string R version 3.3.1 (2016-06-21)\n",
       "nickname       Bug in Your Hair            "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "R.version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## How do to math on the web\n",
    "\n",
    "$$\\sum_{n=1}^\\infty \\frac{1}{n^2} = \\frac{\\pi^2}{6}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "'R version 3.3.1 (2016-06-21)'"
      ],
      "text/latex": [
       "'R version 3.3.1 (2016-06-21)'"
      ],
      "text/markdown": [
       "'R version 3.3.1 (2016-06-21)'"
      ],
      "text/plain": [
       "[1] \"R version 3.3.1 (2016-06-21)\""
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "R.version.string"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ERROR",
     "evalue": "Error in parse(text = x, srcfile = src): <text>:1:1: unexpected SPECIAL\n1: %%\n    ^\n",
     "output_type": "error",
     "traceback": [
      "Error in parse(text = x, srcfile = src): <text>:1:1: unexpected SPECIAL\n1: %%\n    ^\nTraceback:\n"
     ]
    }
   ],
   "source": [
    "%%latex\n",
    "\n",
    "\\[ y_{it} = \\alpha + \\beta d_{it} + f(x_{it} - 0.05) + d_{it} g(x_{it} - 0.05) + \\varepsilon_{it}  \\]\n",
    "\n",
    "%\\[ y_{it} = \\alpha + \\beta d_{it} + \\sum_{k=1}^3 \\gamma_k^b(x_{it} - 0.05)^k + \\sum_{k=1}^3 \\gamma_k^a d_{it} (x_{it} - 0.05)^k + \\varepsilon_{it}  \\]\n",
    "\n",
    "I will likely have multiple experiments from the same client, so it may make sense to add client-level fixed effects (and to cluster the errors at the client level):\n",
    "\n",
    "\\[ y_{ijt} = \\alpha_{j} + \\beta d_{ijt} + f(x_{ijt} - 0.05) + d_{ijt} g(x_{ijt} - 0.05) + \\varepsilon_{ijt}  \\]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "celltoolbar": "Edit Metadata",
  "kernelspec": {
   "display_name": "R",
   "language": "R",
   "name": "ir"
  },
  "language_info": {
   "codemirror_mode": "r",
   "file_extension": ".r",
   "mimetype": "text/x-r-source",
   "name": "R",
   "pygments_lexer": "r",
   "version": "3.3.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
